<!doctype html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>






<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="网络,tcp,broken pipe," />








  <link rel="shortcut icon" type="image/x-icon" href="/uploads/images/logo/favicon.ico?v=5.1.1" />






<meta name="description" content="原文链接：http://lovestblog.cn/blog/2014/05/20/tcp-broken-pipe/ 以前我们经常会碰到Broken pipe或者Connection reset by peer之类的异常，但是tcp实现里什么情况下会抛出这些异常呢，以前我给对方的回答都是模棱两可的，自己说实话都没把握，因为自己也没有验证过，对它们的认识都是从网上看来的，正确与否也不知道，昨天独明突">
<meta name="keywords" content="网络,tcp,broken pipe">
<meta property="og:type" content="article">
<meta property="og:title" content="从tcp原理角度理解Broken pipe和Connection reset by peer的区别">
<meta property="og:url" content="http://xiaoxiaoqiang.win/2017/05/14/网络编程/从tcp原理角度理解Broken-pipe和Connection-reset-by-peer的区别/index.html">
<meta property="og:site_name" content="小小强的部落">
<meta property="og:description" content="原文链接：http://lovestblog.cn/blog/2014/05/20/tcp-broken-pipe/ 以前我们经常会碰到Broken pipe或者Connection reset by peer之类的异常，但是tcp实现里什么情况下会抛出这些异常呢，以前我给对方的回答都是模棱两可的，自己说实话都没把握，因为自己也没有验证过，对它们的认识都是从网上看来的，正确与否也不知道，昨天独明突">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/2492650-99fe64ffbd9455f8.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/2492650-e5655db8bce6f4ec.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/2492650-e10a17f20cea71d8.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/2492650-eb00c345ec6e795f.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/2492650-52b13448f9a3085e.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/2492650-f4de7f7664e33082.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:updated_time" content="2017-07-11T16:09:02.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="从tcp原理角度理解Broken pipe和Connection reset by peer的区别">
<meta name="twitter:description" content="原文链接：http://lovestblog.cn/blog/2014/05/20/tcp-broken-pipe/ 以前我们经常会碰到Broken pipe或者Connection reset by peer之类的异常，但是tcp实现里什么情况下会抛出这些异常呢，以前我给对方的回答都是模棱两可的，自己说实话都没把握，因为自己也没有验证过，对它们的认识都是从网上看来的，正确与否也不知道，昨天独明突">
<meta name="twitter:image" content="http://upload-images.jianshu.io/upload_images/2492650-99fe64ffbd9455f8.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"left","display":"hide","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://xiaoxiaoqiang.win/2017/05/14/网络编程/从tcp原理角度理解Broken-pipe和Connection-reset-by-peer的区别/"/>





  <title>从tcp原理角度理解Broken pipe和Connection reset by peer的区别 | 小小强的部落</title>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  














  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">小小强的部落</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">我思故我在</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="http://xiaoxiaoqiang.win/2017/05/14/网络编程/从tcp原理角度理解Broken-pipe和Connection-reset-by-peer的区别/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="小小强">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/uploads/images/logo/icon.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="小小强的部落">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">从tcp原理角度理解Broken pipe和Connection reset by peer的区别</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-05-14T22:02:05+08:00">
                2017-05-14
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/网络编程/" itemprop="url" rel="index">
                    <span itemprop="name">网络编程</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="原文链接："><a href="#原文链接：" class="headerlink" title="原文链接："></a>原文链接：</h2><p><a href="http://lovestblog.cn/blog/2014/05/20/tcp-broken-pipe/" target="_blank" rel="external">http://lovestblog.cn/blog/2014/05/20/tcp-broken-pipe/</a></p>
<p>以前我们经常会碰到Broken pipe或者Connection reset by peer之类的异常，但是tcp实现里什么情况下会抛出这些异常呢，以前我给对方的回答都是模棱两可的，自己说实话都没把握，因为自己也没有验证过，对它们的认识都是从网上看来的，正确与否也不知道，昨天独明突然又问到这个问题，前段时间正好对tcp这块研究了一段时间，有了点理论知识之后再从实践角度对此问题进行一下分析，下面对我这次的调研过程进行下描述与大家分享，希望大家以后对此类问题都能很自信地应答。</p>
<a id="more"></a>
<h2 id="三次握手和四次挥手过程"><a href="#三次握手和四次挥手过程" class="headerlink" title="三次握手和四次挥手过程"></a>三次握手和四次挥手过程</h2><p>  在讲具体的原因之前，我们有必要补充下tcp这块的一些基础知识，我们都知道tcp通信有三次握手和四次挥手，网上介绍的文章也一大堆，图我也懒得画了，直接网上找一个图给大家</p>
<p><img src="http://upload-images.jianshu.io/upload_images/2492650-99fe64ffbd9455f8.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="tcp_hank.jpg"></p>
<p>三次握手是最前面的三条线表示的过程，四次挥手是最后面的四条线表示的过程，里面涉及到几个关键词，SYN，ACK，FIN，MSS，其中SYN是主要用在三次握手过程中的，FIN用在四次挥手过程中，ACK在三次握手和四次挥手过程中的作用就是对收到的SYN和FIN做一个确认，SYN，FIN等存在于TCP头里(tcp报文图也给大家弄了个图，不用再去找啦)，0/1表示有无此标记，在tcp实现里后面还会跟一个依次递增的数字，比如上面的J，K等，确认就是递增这些数字(真正的数据报文的ack除外)，MSS是表示每一个tcp报文里数据字段的最大长度，不包括tcp头的大小噢 相信大家看到这两个图会对这些概念有了一个清晰的认识了</p>
<p><img src="http://upload-images.jianshu.io/upload_images/2492650-e5655db8bce6f4ec.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="tcp_header.jpg"></p>
<h2 id="tcpdump抓包工具"><a href="#tcpdump抓包工具" class="headerlink" title="tcpdump抓包工具"></a>tcpdump抓包工具</h2><p>  介绍了基础原理之后，再介绍下抓包工具，tcpdump，这工具对你了解tcp的整个过程会非常有帮助，在你无法调试tcp实现的情况下这个工具自然也是必不可少的，具体用法网上有很多介绍，直接从man page上也可以看到详细的介绍，我也不多说啦，下面的截图就是tcpdump根据tcp通信过程获取到的<br><img src="http://upload-images.jianshu.io/upload_images/2492650-e10a17f20cea71d8.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="tcpdump_1.jpg"></p>
<p>这要稍微提下tcpdump的结果和上面的几个过程的对应关系 前面三条其实就是我们上面所说的三次握手，四次握手过程上面没有完全表现出来，只完成了一半的挥手过程（5，8两条表示的） 里面有几个标识S，F，ack，P，其实还有个R，如果有这些标识那么在tcp头里的SYN，FIN，ACK，PSH，RET分别为1，其中PSH表示要求tcp立即将数据传递给上层，不要做别的什么处理，RET这个表示重置连接，也是和我们今天讨论的问题有很大关系的FLAG，下面会详细介绍</p>
<h2 id="reset报文发送场景"><a href="#reset报文发送场景" class="headerlink" title="reset报文发送场景"></a>reset报文发送场景</h2><p>  RST的标志位，这个标识为在如下几种情况下会被设置，以下是我了解的情况，可能还有更多的场景，没有验证</p>
<ul>
<li>当尝试和未开放的服务器端口建立tcp连接时，服务器tcp将会直接向客户端发送reset报文</li>
<li>双方之前已经正常建立了通信通道，也可能进行过了交互，当某一方在交互的过程中发生了异常，如崩溃等，异常的一方会向对端发送reset报文，通知对方将连接关闭</li>
<li>当收到TCP报文，但是发现该报文不是已建立的TCP连接列表可处理的，则其直接向对端发送reset报文</li>
<li>ack报文丢失，并且超出一定的重传次数或时间后，会主动向对端发送reset报文释放该TCP连接<h2 id="Broken-pipe以及Connection-reset-by-peer"><a href="#Broken-pipe以及Connection-reset-by-peer" class="headerlink" title="Broken pipe以及Connection reset by peer"></a>Broken pipe以及Connection reset by peer</h2>  做了这么些铺垫之后下面进入正题，那么Broken pipe或者Connection reset by peer分别代表什么意思呢，下面从glibc的源码里有对此的介绍<blockquote>
<p>TRANS Broken pipe; there is no process reading from the other end of a pipe.<br>TRANS Every library function that returns this error code also generates a<br>TRANS @code{SIGPIPE} signal; this signal terminates the program if not handled<br>TRANS or blocked.  Thus, your program will never actually see @code{EPIPE}<br>TRANS unless it has handled or blocked @code{SIGPIPE}.<br>sysdeps/generic/siglist.h:39 sysdeps/gnu/errlist.c:359<br>sysdeps/unix/siglist.c:39<br>msgid “Broken pipe”<br>msgstr “断开的管道”<br>TRANS A network connection was closed for reasons outside the control of the<br>TRANS local host, such as by the remote machine rebooting or an unrecoverable<br>TRANS protocol violation.<br>sysdeps/gnu/errlist.c:614<br>msgid “Connection reset by peer”<br>msgstr “”</p>
</blockquote>
</li>
</ul>
<p>其实我们java异常里看到的Broken pipe或者Connection reset by peer信息不是jdk或者jvm里定义的，我看到这些关键字往往会首先搜索下jdk或者hotspot源码找到位置进行上下文分析，但是这次没找到，后面才想到应该是linux或者glibc里定义的，果然在glibc离看到了如上的描述和定义<br>  对于Broken pipe在管道的另外一端没有进程再读的时候就会抛出此异常，Connection reset by peer的描述其实不是很正确，从我的实践来看只描述了一方面，其实在某一端正常close之后，也是可能会有此异常的。</p>
<h2 id="异常模拟"><a href="#异常模拟" class="headerlink" title="异常模拟"></a>异常模拟</h2><p>  从我的测试场景是这样的， 共同的前提是客户端向服务端发了数据之后立马调用close关闭socket并进程退出，而服务端在收到客户端的数据之后sleep一会，保证对方的socket已经关闭，接着分别进行两种场景测试</p>
<h3 id="场景："><a href="#场景：" class="headerlink" title="场景："></a>场景：</h3><p>服务端往socket里写一次数据，返回继续做select<br>服务端连续写两次数据，必须保证两次的buffer都是有数据的，也就是保证ByteBuffer的pos和limit要不是一个值</p>
<h3 id="结果："><a href="#结果：" class="headerlink" title="结果："></a>结果：</h3><ol>
<li><p>会抛出Connection reset by peer<br><img src="http://upload-images.jianshu.io/upload_images/2492650-eb00c345ec6e795f.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="tcp_error_1.jpg"></p>
</li>
<li><p>会抛出Broken pipe<br><img src="http://upload-images.jianshu.io/upload_images/2492650-52b13448f9a3085e.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="tcp_error_2.jpg"></p>
<h3 id="分析："><a href="#分析：" class="headerlink" title="分析："></a>分析：</h3><p>当我们往一个对端已经close的通道写数据的时候，对方的tcp会收到这个报文，并且反馈一个reset报文，tcpdump的结果如下所示,当收到reset报文的时候，继续做select读数据的时候就会抛出Connect reset by peer的异常，从堆栈可以看得出</p>
</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/2492650-f4de7f7664e33082.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="tcpdump_2.jpg"></p>
<p>当第一次往一个对端已经close的通道写数据的时候会和上面的情况一样，会收到reset报文，当再次往这个socket写数据的时候，就会抛出Broken pipe了 ，根据tcp的约定，当收到reset包的时候，上层必须要做出处理，调用将socket文件描述符进行关闭，其实也意味着pipe会关闭，因此会抛出这个顾名思义的异常</p>
<h3 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h3><p><a href="http://www.cnblogs.com/fgokey/p/5949004.html" target="_blank" rel="external">http://www.cnblogs.com/fgokey/p/5949004.html</a></p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="/uploads/images/money/wechat.JPG" alt="小小强 WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="/uploads/images/money/ali.JPG" alt="小小强 Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/网络/" rel="tag"># 网络</a>
          
            <a href="/tags/tcp/" rel="tag"># tcp</a>
          
            <a href="/tags/broken-pipe/" rel="tag"># broken pipe</a>
          
        </div>
      

      
        
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/05/14/网络编程/同步、异步、阻塞及非阻塞/" rel="next" title="同步、异步、阻塞及非阻塞">
                <i class="fa fa-chevron-left"></i> 同步、异步、阻塞及非阻塞
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/05/14/网络编程/网络编程中send和recv常见错误梳理/" rel="prev" title="网络编程中send和recv常见错误梳理">
                网络编程中send和recv常见错误梳理 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="uyan_frame"></div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/uploads/images/logo/icon.jpg"
               alt="小小强" />
          <p class="site-author-name" itemprop="name">小小强</p>
           
              <p class="site-description motion-element" itemprop="description">技术之路历练</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">18</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">5</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">18</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/wayd2001" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.jianshu.com/u/5813fda87ee0" target="_blank" title="JianShu">
                  
                    <i class="fa fa-fw fa-book"></i>
                  
                  JianShu
                </a>
              </span>
            
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              Links
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.jianshu.com/u/5813fda87ee0" title="小小强简书" target="_blank">小小强简书</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#原文链接："><span class="nav-number">1.</span> <span class="nav-text">原文链接：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#三次握手和四次挥手过程"><span class="nav-number">2.</span> <span class="nav-text">三次握手和四次挥手过程</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#tcpdump抓包工具"><span class="nav-number">3.</span> <span class="nav-text">tcpdump抓包工具</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#reset报文发送场景"><span class="nav-number">4.</span> <span class="nav-text">reset报文发送场景</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Broken-pipe以及Connection-reset-by-peer"><span class="nav-number">5.</span> <span class="nav-text">Broken pipe以及Connection reset by peer</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#异常模拟"><span class="nav-number">6.</span> <span class="nav-text">异常模拟</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#场景："><span class="nav-number">6.1.</span> <span class="nav-text">场景：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#结果："><span class="nav-number">6.2.</span> <span class="nav-text">结果：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#分析："><span class="nav-number">6.3.</span> <span class="nav-text">分析：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#参考资料"><span class="nav-number">6.4.</span> <span class="nav-text">参考资料</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>
<span id="busuanzi_container_site_pv">
    本站总访问量<span id="busuanzi_value_site_pv"></span>次
</span>

<span id="busuanzi_container_site_uv">
  本站访客数<span id="busuanzi_value_site_uv"></span>人次
</span>


<div class="copyright" >
  
  &copy;  2017 - 
  <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">小小强</span>
</div>



<div class="powered-by">
  由 <a class="theme-link" href="#">小小强</a> 个人专属
</div>

<div class="theme-info">
  博客 -
  <a class="theme-link" href="#">
   小小强
  </a>
</div>
<p>Hosted by <a href="https://pages.coding.me" style="font-weight: bold">Coding Pages</a></p>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  
    

    
      <!-- UY BEGIN -->
      <script type="text/javascript" src="http://v2.uyan.cc/code/uyan.js?uid=2138352"></script>
      <!-- UY END -->
    
  





  






  





  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  

  

  



</body>
</html>
